package com.lianbang.pharmacy.http.api

import cn.ubest.mvvmcore.bean.ListDataWrapper
import cn.ubest.mvvmcore.bean.ListWrapper
import cn.ubest.mvvmcore.bean.ResultWrapper
import com.lianbang.pharmacy.bean.*
import retrofit2.http.*

/**
 * Created by maoqi on 2020/12/18.
 */
interface MedicineApi {
    //供应商列表
    @POST("public_api/index_search_merchants")
    suspend fun supplierList(): ListWrapper<SupplierListBean>

    //搜索药品
    @FormUrlEncoded
    @POST("store_api/get_product_list")
    suspend fun searchMedicine(
        @Field("keyword") keyword: String,
        @Field("news") news: Int
    ): ListWrapper<MedicineListBean>


    //药品信息
    @FormUrlEncoded
    @POST("store_api/select_merchant_product")
    suspend fun medicineInfo(
        @Field("id") id: Int
    ): ResultWrapper<MedicineInfoBean>

    //药品供应商列表
    @FormUrlEncoded
    @POST("store_api/select_merchant")
    suspend fun medicineSupplierList(
        @Field("id") id: Int
    ): ListWrapper<MedicineSupplierListBean>

    //获取药品三级分类
    @POST("store_api/get_product_category")
    suspend fun medicineCategoryList(): ListDataWrapper<MedicineCategoryListBean>

}